//
//  UIView+NotDataPrompt.m
//  KangLian
//
//  Created by ZSMAC on 2018/9/27.
//  Copyright © 2018年 Mask. All rights reserved.
//

#import "UIView+NotDataPrompt.h"
#import "NoDataPromptView.h"

@implementation UIView (NotDataPrompt)
- (void)addNoDataPromptView {
  NoDataPromptView * promptView=[[NoDataPromptView alloc] initWithFrame:CGRectMake(30, 150, SCREEN_WIDTH-60, 150)];
    promptView.showType=Not_Data_Type;
    promptView.hidden=YES;
    [self addSubview:promptView];
}
- (void)addPromptViewType:(NotDataType)showType {
    CGFloat height = 150;
    NoDataPromptView * promptView=[[NoDataPromptView alloc] initWithFrame:CGRectMake(30, (self.height/2)-(height/2), self.width-60, height)];
    promptView.showType=showType;
    promptView.hidden=YES;
    [self addSubview:promptView];
}
- (void)promptViewIsHidden:(BOOL)IsHidden {
    for (id obj in self.subviews) {
        if ([obj isKindOfClass:[NoDataPromptView class]]) {
            UIView *promptView = ( UIView *)obj;
            promptView.hidden=IsHidden;
        }
    }
}
@end
